<?php

namespace App\Admin\Forms;

use Dcat\Admin\Traits\LazyWidget;
use Dcat\Admin\Widgets\Form;

class AuditRemarkForm extends Form
{
    use LazyWidget;
    /**
     * Handle the form request.
     *
     * @param array $input
     *
     * @return mixed
     */
    public function handle(array $input)
    {
        // dump($input);

        // return $this->response()->error('Your error message.');

        return $this
            ->response()
            ->success('操作成功')
            ->refresh();
    }

    /**
     * Build a form here.
     */
    public function form()
    {
        $row = $this->payload['row'] ?? null;
        $this->textarea('audit_remark')->value($row['audit_remark'] ?? '')->disable();
    }

    /**
     * The data of the form.
     *
     * @return array
     */
    public function
    default()
    {
        return [
            'name'  => 'John Doe',
            'email' => 'John.Doe@gmail.com',
        ];
    }
}
